<template>
	<view class="item_score">
		<view class="score_model">
			<uni-rate class="rate-score" :value="pscore" :size="size" :margin="margin" :activeColor="activeColor"
				:allowHalf="true" :readonly="true" :is-fill="false" />
		</view>
		<text class="score_value">{{pscore}}</text>
	</view>
</template>
<script>
	export default {
		name: "item-score",
		props: {
			score: [String, Number]
		},
		data() {
			return {
				size: uni.upx2px(32),
				activeColor: '#FF6C25',
				margin: uni.upx2px(8)
			}
		},
		computed: {
			pscore() {
				return this.score != 0 ? this.score.toFixed(1) : '5.0';
			}
		},
		methods: {

		}
	}
</script>
<style lang="scss">
	.item_score {
		display: flex;
		align-items: center;

		.score_model {
			display: inline-block;
			margin-right: 10rpx;
		}

		.score_value {
			font-size: 28rpx;
			font-weight: normal;
			color: #FF6C25;
		}
	}
</style>
